The present invention relates to a method for efficiently monitoring program execution during a program run on a computer.
A most commonly used method for monitoring the execution of a program run on a computer is, for example, embedding code for log output into program source code and compiling the source code, so that execution logs are obtained during program execution, which is a basic technique for developing programs. This kind of technique has been disclosed in, for example, Japanese Patent Laid-Open No. H6(1994)-314221.
Most debuggers that are now available realize their function by inserting debug code into a program. For example, a software interrupt instruction is embedded into a program so that the interrupt occurs when the instruction code is executed and thereby the program execution can be checked easily. This kind of technique has been disclosed in, for example, Japanese Patent Laid-Open No. H11(1999)-184727.
Profiling tools which measure runtime per segment of a program to detect a bottleneck in the program execution are available and often used in a program optimization process. These tools insert monitor code into a program during a read of the program and monitor the program execution state by executing the monitor code.
In order to implement the above-mentioned method of embedding code for log output into program source, the program source and an environment for compiling the source are necessary. In the absence of either of these necessities, the above method cannot be practiced. The debuggers are developed to be used when programs are developed and it is difficult to apply them to low-load use during program execution. Besides, the debuggers cannot be used in an execution environment for interpreter programs.
As for the profiling tools, a complex process is required for inserting monitor code into a program without affecting the program operation (for example, stack manipulation is required for monitoring arguments).